package com.klikmee.sms.core.base.subscription;

import java.util.Date;
import java.util.Hashtable;

public interface SubscriptionManager {
	
	public static final String	DISTRIBUTION_LIST_NAME	= "DISTRIBUTION_LIST_NAME";
	public static final String	DISTRIBUTION_LIST_ID	= "DISTRIBUTION_LIST_ID";

	/**
	 * 
	 * @param serviceId MTS service id
	 * @param message text of user's message sent in subscription request
	 * @return Hashtable with keys DistributionListId eg DLBULK and ExtensionName eg BULK
	 * @throws NoDistributionListFoundException
	 */
	public Hashtable<String, String> getSubscriptionDetail( String serviceId, String message ) throws NoDistributionListFoundException;

	/**
	 * 
	 * @param msisdn users phone number in format 3816..
	 * @param serviceId MTS service id from admin portal
	 * @param distributionList id of distribution list in format DL+distribution name
	 * @param validTo date until subscription is valid
	 */
	public void receiveSubacription( String msisdn, String serviceId, String distributionList, Date validTo );

	/**
	 * Invoked by SDP to inform service provider that user is about to be unsubscribed from distribution list.
	 * @param msisdn user's phone number in format 3816xxx
	 * @param serviceId id of service which is user unsubscribing from.
	 * @param distributionListId id of distribution list. If this parameter is null then user is to be removed from all distribution list belonging to this service.
	 */
	public void receiveUnsubscription( String msisdn, String serviceId, String distributionListId );

	/**
	 * 
	 * @param msisdn
	 * @param serviceId
	 * @param distributionList
	 * @param validTo
	 */
	public void receiveSubscriptionExtension( String msisdn, String serviceId, String distributionList, Date validTo );

}
